package models

import "strconv"

// wxuser表模型结构
type Wxuser struct {
	ID
	UserId     uint   `json:"user_id" gorm:"not null;default 0;comment:用户主ID"`
	OpenId     string `json:"open_id" gorm:"not null;comment:微信open_id"`
	UnionID    string `json:"union_id" gorm:"not null;comment:微信的union_id"`
	NickName   string `josn:"nick_name" gorm:"not null;comment:微信昵称"`
	Gender     uint8  `json:"gender" gorm:"not null;comment:性别"`
	City       string `json:"city" gorm:"not null;comment:城市"`
	Province   string `json:"province" gorm:"not null;comment:省份"`
	Country    string `json:"country" gorm:"not null;comment:国家"`
	Avatar     string `json:"avatar" gorm:"not null;comment:头像url"`
	Mobile     string `json:"mobile" gorm:"not null;commont:手机号"`
	PureMobile string `json:"pure_mobile" gorm:"not null;comment:微信的PurePhoneNumber"`
	Timestamps
	SoftDeletes
}

// GetUid 获取微信用户对应的Uid
func (u Wxuser) GetUid() string {
	return strconv.Itoa(int(u.UserId))
}
